<template>
  <div class="not-found">
    <!-- 背景装饰 -->
    <div class="background-decoration">
      <div class="circle circle-1"></div>
      <div class="circle circle-2"></div>
      <div class="circle circle-3"></div>
    </div>

    <div class="not-found-content">
      <!-- 404动画插图 -->
      <div class="illustration">
        <div class="error-code">
          <span class="number">4</span>
          <div class="icon-wrapper">
            <font-awesome-icon :icon="['fas', 'door-open']" class="door-icon" />
          </div>
          <span class="number">4</span>
        </div>
      </div>

      <!-- 文本内容 -->
      <div class="text-content">
        <h1 class="title">页面走丢了</h1>
        <p class="description">
          抱歉，您访问的页面似乎不存在或已被移除
        </p>
        <p class="hint">
          <font-awesome-icon :icon="['fas', 'lightbulb']" />
          请检查网址是否正确，或返回首页继续浏览
        </p>
      </div>

      <!-- 操作按钮 -->
      <div class="actions">
        <a-button type="primary" size="large" @click="goHome" class="action-btn primary-btn">
          <template #icon>
            <font-awesome-icon :icon="['fas', 'home']" />
          </template>
          返回首页
        </a-button>
        <a-button size="large" @click="goBack" class="action-btn">
          <template #icon>
            <font-awesome-icon :icon="['fas', 'arrow-left']" />
          </template>
          返回上页
        </a-button>
      </div>

      <!-- 友好提示链接 -->
      <div class="helpful-links">
        <span class="link-title">您可能需要：</span>
        <div class="links">
          <a @click="router.push('/dashboard')" class="link-item">
            <font-awesome-icon :icon="['fas', 'chart-line']" />
            仪表盘
          </a>
          <a @click="router.push('/rooms')" class="link-item">
            <font-awesome-icon :icon="['fas', 'bed']" />
            房间管理
          </a>
          <a @click="router.push('/reservations')" class="link-item">
            <font-awesome-icon :icon="['fas', 'calendar-check']" />
            预订管理
          </a>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faDoorOpen, faHome, faArrowLeft, faLightbulb, faChartLine, faBed, faCalendarCheck } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

library.add(faDoorOpen, faHome, faArrowLeft, faLightbulb, faChartLine, faBed, faCalendarCheck)

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style scoped>
.not-found {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  position: relative;
  overflow: hidden;
  padding: 20px;
}

/* 背景装饰圆圈 */
.background-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 20s infinite ease-in-out;
}

.circle-1 {
  width: 300px;
  height: 300px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.circle-2 {
  width: 200px;
  height: 200px;
  top: 60%;
  right: 15%;
  animation-delay: 5s;
}

.circle-3 {
  width: 150px;
  height: 150px;
  bottom: 20%;
  left: 50%;
  animation-delay: 10s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-30px) scale(1.1);
  }
}

/* 内容卡片 */
.not-found-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 40px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 600px;
  width: 100%;
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 404插图 */
.illustration {
  margin-bottom: 40px;
}

.error-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 120px;
  font-weight: 900;
  color: #2563eb;
  line-height: 1;
}

.number {
  animation: bounce 2s infinite;
}

.number:first-child {
  animation-delay: 0s;
}

.number:last-child {
  animation-delay: 0.2s;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

.icon-wrapper {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border-radius: 50%;
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.door-icon {
  font-size: 60px;
  color: white;
}

/* 文本内容 */
.text-content {
  margin-bottom: 40px;
}

.title {
  font-size: 36px;
  font-weight: 700;
  color: #1d2129;
  margin: 0 0 16px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.description {
  font-size: 18px;
  color: #4e5969;
  margin: 0 0 16px;
  line-height: 1.6;
}

.hint {
  font-size: 14px;
  color: #86909c;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: #f7f8fa;
  border-radius: 8px;
  margin: 0 auto;
  max-width: 400px;
}

.hint svg {
  color: #f7ba2a;
}

/* 操作按钮 */
.actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
}

.action-btn {
  min-width: 140px;
  height: 44px;
  border-radius: 22px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.primary-btn {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  border: none;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.action-btn:not(.primary-btn) {
  border-color: #2563eb;
  color: #2563eb;
}

.action-btn:not(.primary-btn):hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  transform: translateY(-2px);
}

/* 友好链接 */
.helpful-links {
  border-top: 1px solid #e5e6eb;
  padding-top: 24px;
}

.link-title {
  display: block;
  font-size: 14px;
  color: #86909c;
  margin-bottom: 12px;
}

.links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #2563eb;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 8px;
}

.link-item:hover {
  background: #f2f3f5;
  transform: translateX(4px);
}

.link-item svg {
  font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .not-found-content {
    padding: 40px 24px;
    margin: 16px;
  }
  
  .error-code {
    font-size: 80px;
    gap: 10px;
  }
  
  .icon-wrapper {
    width: 80px;
    height: 80px;
  }
  
  .door-icon {
    font-size: 40px;
  }
  
  .title {
    font-size: 28px;
  }
  
  .description {
    font-size: 16px;
  }
  
  .actions {
    flex-direction: column;
  }
  
  .action-btn {
    width: 100%;
  }
  
  .links {
    flex-direction: column;
    gap: 12px;
  }
  
  .circle-1,
  .circle-2,
  .circle-3 {
    display: none;
  }
}

@media (max-width: 480px) {
  .error-code {
    font-size: 60px;
  }
  
  .icon-wrapper {
    width: 60px;
    height: 60px;
  }
  
  .door-icon {
    font-size: 30px;
  }
}
</style>
